home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibclean / xstring.h < prev    next >
C/C++ Source or Header  |  1992-11-04  |  5KB  |  134 lines

  1. /* -*-C-*- xstring.h */
  2. /**********************************************************************/
  3. /****************************** string ********************************/
  4. /**********************************************************************/
  5.  
  6. /* $Id: xstring.h,v 1.6 1992/10/08 01:42:01 beebe Exp beebe $
  7.  * $Log: xstring.h,v $
  8.  * Revision 1.6  1992/10/08  01:42:01  beebe
  9.  * Update for C++.
  10.  *
  11.  * Revision 1.5  1992/07/10  18:08:22  beebe
  12.  * Remove Lattice C support.
  13.  * Change definition of NULL.
  14.  *
  15.  * Revision 1.4  1992/03/06  14:58:06  beebe
  16.  * Complete two-month long development of version 3.0.114.  See
  17.  * 00revhst.txt for details.
  18.  *
  19.  * Revision 1.3  1992/03/06  14:55:54  beebe
  20.  * Complete two-month long development of version 3.0.114.  See
  21.  * 00revhst.txt for details.
  22.  *
  23.  * Revision 1.3  1992/03/06  14:55:54  beebe
  24.  * Complete two-month long development of version 3.0.114.  See
  25.  * 00revhst.txt for details.
  26.  *
  27.  * Revision 1.3  1992/03/06  14:54:22  beebe
  28.  * Complete two-month long development of version 3.0.114.  See
  29.  *
  30.  * Revision 1.2  1992/02/29  19:42:20  beebe
  31.  * Update for version 3.0.114 [29-Feb-1992] following two-month
  32.  * major overhaul and compilation testing on numerous machines.
  33.  *
  34.  */
  35.  
  36. #ifndef XSTRING_H_DEFINED_    /* file ignored if included more than once */
  37. #define XSTRING_H_DEFINED_
  38.  
  39. #ifndef OS_H_DEFINED_
  40. #include "os.h"
  41. #endif /* OS_H_DEFINED_ */
  42.  
  43. /* Standard C, System V, and BSD 4.3 call this <string.h>.  BSD 4.1 called it
  44. <strings.h> */
  45.  
  46. #if    STDC
  47. #include <string.h>        /* get the host version */
  48.  
  49. #if __GNUG__
  50. extern "C"
  51. {
  52. VOIDP        memmove ARGS((VOIDP dest_,  const VOIDP src_,  size_t n_));
  53.     /* missing from /usr/local/lib/g++-include/string.h in g++ 2.0 */
  54. };
  55. #endif 
  56.  
  57.  
  58. #if    !HAVE_MEMXXX_DCL
  59. /* Some systems have these in memory.h, but without argument
  60. declarations, and sometimes, with wrong return types.  We use the
  61. Standard C declarations here, rather than using memory.h, because the
  62. latter causes other conflicts that we wish to avoid.  */
  63. VOIDP        memccpy ARGS((VOIDP dest_,  const VOIDP src_,  int c_,
  64.             size_t n_));    /* Extension to Standard C */
  65. VOIDP        memchr    ARGS((const VOIDP s_,  int c_,  size_t n_));
  66. int        memcmp    ARGS((const VOIDP s1_,  const VOIDP s2_,
  67.             size_t n_));
  68. VOIDP        memcpy    ARGS((VOIDP dest_,  const VOIDP src_,  size_t n_));
  69. int        memicmp ARGS((const VOIDP s1_,  const VOIDP s2_,
  70.             size_t n_));    /* Extension to Standard C */
  71. VOIDP        memmove ARGS((VOIDP dest_,  const VOIDP src_,  size_t n_));
  72. VOIDP        memset    ARGS((VOIDP s_,  int c_,  size_t n_));
  73. #endif /* !HAVE_MEMXXX_DCL */
  74.  
  75. #else /* NOT STDC */
  76.  
  77. #include "xtypes.h"
  78.  
  79. /* Strictly, size_t must be defined in Standard C's string.h, but
  80. since it is usually typedef'ed, e.g. "typedef long size_t" or "typedef
  81. int size_t", sometimes with the unsigned attribute, we have no way of
  82. checking here for a prior definition, so we can do nothing for it. */
  83.  
  84. #ifndef NULL
  85. #if    KCC_20
  86. /* has its own version in stdio.h */
  87. #else  /* NOT KCC_20 */
  88. #define NULL            ((VOIDP) 0L)    /* this is SYSTEM-DEPENDENT */
  89. #endif /* KCC_20 */
  90. #endif /* NULL */
  91.  
  92. /* Some UNIX systems have the memxxx() functions in <memory.h>.
  93. Standard C puts them in <string.h>. */
  94.  
  95. VOIDP        memccpy ARGS((VOIDP dest_,  const VOIDP src_,  int c_,
  96.             size_t n_));    /* Extension to Standard C */
  97. VOIDP        memchr    ARGS((const VOIDP s_,  int c_,  size_t n_));
  98. int        memcmp    ARGS((const VOIDP s1_,  const VOIDP s2_,
  99.             size_t n_));
  100. VOIDP        memcpy    ARGS((VOIDP dest_,  const VOIDP src_,  size_t n_));
  101. int        memicmp ARGS((const VOIDP s1_,  const VOIDP s2_,
  102.             size_t n_));    /* Extension to Standard C */
  103. VOIDP        memmove ARGS((VOIDP dest_,  const VOIDP src_,  size_t n_));
  104. VOIDP        memset    ARGS((VOIDP s_,  int c_,  size_t n_));
  105. char        *strcat ARGS((char *s1_,  const char *s2_));
  106. char        *strchr ARGS((const char *s_,  int character_));
  107. int        strcmp ARGS((const char *s1_,  const char *s2_));
  108. int        strcoll ARGS((const char *s1_, const char *s2_));
  109. char        *strcpy ARGS((char *s1_,  const char *s2_));
  110. size_t        strcspn ARGS((const char *s1_,  const char *s2_));
  111. char        *strerror ARGS((int errnum_,  ...));
  112. size_t        strlen ARGS((const char *s_));
  113. char        *strncat ARGS((char *s1_,  const char *s2_,  size_t n_));
  114. int        strncmp ARGS((const char *s1_,  const char *s2_,
  115.             size_t n_));
  116. char        *strncpy ARGS((char *s1_,  const char *s2_,  size_t n_));
  117. char        *strpbrk ARGS((const char *s1_,  const char *s2_));
  118. char        *strrchr ARGS((const char *s_,  int character_));
  119. size_t        strspn ARGS((const char *s1_,  const char *s2_));
  120. char        *strstr ARGS((const char *s1_,  const char *s2_));
  121. char        *strtok ARGS((char *s1_,  const char *s2_));
  122. size_t        strxfrm ARGS((char *to_, const char *from_,
  123.             size_t maxsize_));
  124. #endif /* STDC */
  125.  
  126. /* Define a few additional functions used in the DVI driver family */
  127.  
  128. char         *strdup ARGS((const char * s_));
  129. int        stricmp ARGS((const char *, const char *));
  130. char        *stristr ARGS((const char *s_, const char *sub_));
  131. int        strnicmp ARGS((const char *s1_, const char *s2_, size_t n_));
  132.  
  133. #endif /* XSTRING_H_DEFINED_ */
  134.